package com.yumeng.common.exception;

import com.yumeng.common.api.ApiCode;

/**
 * 基础授权异常
 *
 * @author wxd
 * @date 2021/8/22 23:04
 */
public abstract class BasePermException extends BaseException{

    public BasePermException(Throwable e) {
        super(e);
    }

    public BasePermException(String message, Object... args) {
        super(message, args);
    }

    public BasePermException(Throwable e, String message, Object... args) {
        super(e, message, args);
    }

    @Override
    public RuntimeException setApiCode(ApiCode apiCode) {
        super.setApiCode(apiCode);
        return this;
    }

    @Override
    protected ApiCode defaultApiCode(){
        return ApiCode.FORBIDDEN;
    }

    @Override
    public boolean hasCustomApiCode(){
        return true;
    }
}
